Integrand size = 21, antiderivative size = 51 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {(a+2 b) \text {arctanh}(\cos (e+f x))}{2 f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f}+\frac {b \sec (e+f x)}{f} \]
Leaf count is larger than twice the leaf count of optimal. \(123\) vs. \(2(51)=102\).
Time = 0.32 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.41 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {a \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}-\frac {b \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {b \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {a \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {b \sec (e+f x)}{f} \]
-1/8*(a*Csc[(e + f*x)/2]^2)/f - (a*Log[Cos[(e + f*x)/2]])/(2*f) - (b*Log[C os[(e + f*x)/2]])/f + (a*Log[Sin[(e + f*x)/2]])/(2*f) + (b*Log[Sin[(e + f* x)/2]])/f + (a*Sec[(e + f*x)/2]^2)/(8*f) + (b*Sec[e + f*x])/f
Time = 0.23 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.14, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4147, 360, 299, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+b \tan (e+f x)^2}{\sin (e+f x)^3}dx\) |
\(\Big \downarrow \) 4147 |
\(\displaystyle \frac {\int \frac {\sec ^2(e+f x) \left (b \sec ^2(e+f x)+a-b\right )}{\left (1-\sec ^2(e+f x)\right )^2}d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 360 |
\(\displaystyle \frac {\frac {a \sec (e+f x)}{2 \left (1-\sec ^2(e+f x)\right )}-\frac {1}{2} \int \frac {2 b \sec ^2(e+f x)+a}{1-\sec ^2(e+f x)}d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 299 |
\(\displaystyle \frac {\frac {1}{2} \left (2 b \sec (e+f x)-(a+2 b) \int \frac {1}{1-\sec ^2(e+f x)}d\sec (e+f x)\right )+\frac {a \sec (e+f x)}{2 \left (1-\sec ^2(e+f x)\right )}}{f}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\frac {1}{2} (2 b \sec (e+f x)-(a+2 b) \text {arctanh}(\sec (e+f x)))+\frac {a \sec (e+f x)}{2 \left (1-\sec ^2(e+f x)\right )}}{f}\) |
((-((a + 2*b)*ArcTanh[Sec[e + f*x]]) + 2*b*Sec[e + f*x])/2 + (a*Sec[e + f* x])/(2*(1 - Sec[e + f*x]^2)))/f
3.1.34.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[d*x *((a + b*x^2)^(p + 1)/(b*(2*p + 3))), x] - Simp[(a*d - b*c*(2*p + 3))/(b*(2 *p + 3)) Int[(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && NeQ[2*p + 3, 0]
Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] : > Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p + 1))), x] + Simp[1/(2*b^(m/2 + 1)*(p + 1)) Int[(a + b*x^2)^(p + 1)*Expan dToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)] - (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[m/2, 0] & & (IntegerQ[p] || EqQ[m + 2*p + 1, 0])
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^ (p_.), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Simp[1/(f*ff^ m) Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m + 1 )), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[( m - 1)/2]
Time = 0.32 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.33
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )+b \left (\frac {1}{\cos \left (f x +e \right )}+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )\right )}{f}\) | \(68\) |
default | \(\frac {a \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )+b \left (\frac {1}{\cos \left (f x +e \right )}+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )\right )}{f}\) | \(68\) |
risch | \(\frac {{\mathrm e}^{i \left (f x +e \right )} \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a +2 b \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{2 f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) b}{f}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{2 f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) b}{f}\) | \(176\) |
1/f*(a*(-1/2*csc(f*x+e)*cot(f*x+e)+1/2*ln(csc(f*x+e)-cot(f*x+e)))+b*(1/cos (f*x+e)+ln(csc(f*x+e)-cot(f*x+e))))
Leaf count of result is larger than twice the leaf count of optimal. 124 vs. \(2 (47) = 94\).
Time = 0.28 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.43 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {2 \, {\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - {\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - {\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 4 \, b}{4 \, {\left (f \cos \left (f x + e\right )^{3} - f \cos \left (f x + e\right )\right )}} \]
1/4*(2*(a + 2*b)*cos(f*x + e)^2 - ((a + 2*b)*cos(f*x + e)^3 - (a + 2*b)*co s(f*x + e))*log(1/2*cos(f*x + e) + 1/2) + ((a + 2*b)*cos(f*x + e)^3 - (a + 2*b)*cos(f*x + e))*log(-1/2*cos(f*x + e) + 1/2) - 4*b)/(f*cos(f*x + e)^3 - f*cos(f*x + e))
\[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{3}{\left (e + f x \right )}\, dx \]
Time = 0.26 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.49 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {{\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - {\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - 2 \, b\right )}}{\cos \left (f x + e\right )^{3} - \cos \left (f x + e\right )}}{4 \, f} \]
-1/4*((a + 2*b)*log(cos(f*x + e) + 1) - (a + 2*b)*log(cos(f*x + e) - 1) - 2*((a + 2*b)*cos(f*x + e)^2 - 2*b)/(cos(f*x + e)^3 - cos(f*x + e)))/f
Leaf count of result is larger than twice the leaf count of optimal. 171 vs. \(2 (47) = 94\).
Time = 0.43 (sec) , antiderivative size = 171, normalized size of antiderivative = 3.35 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {2 \, {\left (a + 2 \, b\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right ) - \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a + \frac {14 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {2 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + \frac {{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}}{8 \, f} \]
1/8*(2*(a + 2*b)*log(abs(-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1)) - a*(co s(f*x + e) - 1)/(cos(f*x + e) + 1) + (a + 14*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 2*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + ( cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2))/f
Time = 10.24 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.86 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,f}-\frac {\frac {a}{2}-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a}{2}+8\,b\right )}{f\,\left (4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (\frac {a}{2}+b\right )}{f} \]